package com.rain.cy.business.service;

import com.rain.cy.business.mapper.UserMapper;
import com.rain.cy.business.model.entity.UserEntity;
import com.rain.cy.framework.entity.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author yuchen
 * @since 2021-10-02
 */
@Service
public class UserService extends BaseServiceImpl<UserMapper, UserEntity> {


    public Map<Integer, UserEntity> getDoctorMap() {
        return lambdaQuery().eq(UserEntity::getUserType, 0).list()
                .stream().collect(Collectors.toMap(
                        UserEntity::getId,
                        userEntity -> userEntity
                ));
    }


}
